namespace Expect.Documentation.Advanced_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Using setup and teardown from another specification file", Path="\\Advanced concepts\\Using setup and teardown from another specification file.expec" +
        "t")]
    public partial class UsingSetupAndTeardownFromAnotherSpecificationFileContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Using setup and teardown from another specification file.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void UsingSetupAndTeardownFromAnotherSpecificationFileClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            Get_AStandaloneSetup(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [SetupProviderAttribute(Name="a standalone setup")]
        public virtual void Get_AStandaloneSetup(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "a standalone setup";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture();
#line 3
            fixture.WithRow("This setup will be used in another specification file");
#line hidden
            fixture.EndRun();

        }
        
        [TestCleanup()]
        public virtual void UsingSetupAndTeardownFromAnotherSpecificationFileClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            Get_AStandaloneTeardown(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        [TeardownProviderAttribute(Name="a standalone teardown")]
        public virtual void Get_AStandaloneTeardown(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "a standalone teardown";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture();
#line 7
            fixture.WithRow("This teardown will be used in another specification file");
#line hidden
            fixture.EndRun();

        }
    }
}
